#include <memory>
#include "err.hpp"
#include "selectServer.hpp"

using namespace select_ns;

static void Usage(std::string proc)
{
	std::cerr << "\nUsage:\n\t" << proc << ": port\n\n";
}

std::string transaction(const std::string &request)
{
    return request;
}

int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    std::unique_ptr<selectServer> svr(new selectServer(transaction, atoi(argv[1])));

    svr->initServer();

    svr->start();

    return 0;
}